package com.cskaoyan.mall.product.config;


import io.minio.MinioClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties(prefix = "minio")
public class MyMinioConfig {
    String endpointUrl;
    String accessKey;
    String secreKey;
    String bucketName;
    @Bean
    public MinioClient minioConfig(){
        MinioClient minioClient = MinioClient.builder()
                .endpoint(endpointUrl)
                .credentials(accessKey, secreKey)
                .build();

        return minioClient;

    }
}
